package net.shenru.modle.map;

/**
 * 对应物理一个点
 */
public class SrGeoPoint {

	public static final long INVALID_LATITUDE = 1024;
	public static final long INVALID_LONGITUDE = 1024;
	
	private String name;
	private GeoPointType type;

	private long latitude;
	private long longitude;

	private long systemLatitude;
	private long systemLongitude;
	
	private long baiduLatitude;
	private long baiduLongitude;

	public long getLatitude() {
		return latitude;
	}

	public void setLatitude(long latitude) {
		this.latitude = latitude;
		switch (type) {
		case System:
			systemLatitude = latitude;
			break;
		case Baidu:
			baiduLatitude = latitude;
			break;
		}
	}

	public long getLongitude() {
		return longitude;
	}

	public void setLongitude(long longitude) {
		this.longitude = longitude;
		switch (type) {
		case System:
			systemLongitude = longitude;
			break;
		case Baidu:
			baiduLongitude = longitude;
			break;
		}
	}

	public GeoPointType getType() {
		return type;
	}

	public void setType(GeoPointType type) {
		this.type = type;
	}

	public long getLatitude(GeoPointType type) {
		switch (type) {
		case System:
			return systemLatitude;
		case Baidu:
			return baiduLatitude;
		}
		return INVALID_LATITUDE;
	}

	public long getLongitude(GeoPointType type) {
		switch (type) {
		case System:
			return systemLongitude;
		case Baidu:
			return baiduLongitude;
		}
		return INVALID_LONGITUDE;
	}

}
